3.2.8 \(\int (a+b x)^3 (A+B x) \, dx\) [108]

Optimal. Leaf size=38 \[ \frac {(A b-a B) (a+b x)^4}{4 b^2}+\frac {B (a+b x)^5}{5 b^2} \]

[Out]

1/4*(A*b-B*a)*(b*x+a)^4/b^2+1/5*B*(b*x+a)^5/b^2

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.077, Rules used = {45} \begin {gather*} \frac {(a+b x)^4 (A b-a B)}{4 b^2}+\frac {B (a+b x)^5}{5 b^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*x)^3*(A + B*x),x]

[Out]

((A*b - a*B)*(a + b*x)^4)/(4*b^2) + (B*(a + b*x)^5)/(5*b^2)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rubi steps

\begin {align*} \int (a+b x)^3 (A+B x) \, dx &=\int \left (\frac {(A b-a B) (a+b x)^3}{b}+\frac {B (a+b x)^4}{b}\right ) \, dx\\ &=\frac {(A b-a B) (a+b x)^4}{4 b^2}+\frac {B (a+b x)^5}{5 b^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 67, normalized size = 1.76 \begin {gather*} a^3 A x+\frac {1}{2} a^2 (3 A b+a B) x^2+a b (A b+a B) x^3+\frac {1}{4} b^2 (A b+3 a B) x^4+\frac {1}{5} b^3 B x^5 \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b*x)^3*(A + B*x),x]

[Out]

a^3*A*x + (a^2*(3*A*b + a*B)*x^2)/2 + a*b*(A*b + a*B)*x^3 + (b^2*(A*b + 3*a*B)*x^4)/4 + (b^3*B*x^5)/5

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(72\) vs. \(2(34)=68\).
time = 0.07, size = 73, normalized size = 1.92

method result size
norman \(\frac {b^{3} B \,x^{5}}{5}+\left (\frac {1}{4} b^{3} A +\frac {3}{4} a \,b^{2} B \right ) x^{4}+\left (a \,b^{2} A +a^{2} b B \right ) x^{3}+\left (\frac {3}{2} a^{2} b A +\frac {1}{2} a^{3} B \right ) x^{2}+a^{3} A x\) \(70\)
gosper \(\frac {1}{5} b^{3} B \,x^{5}+\frac {1}{4} x^{4} b^{3} A +\frac {3}{4} x^{4} a \,b^{2} B +A a \,b^{2} x^{3}+B \,a^{2} b \,x^{3}+\frac {3}{2} x^{2} a^{2} b A +\frac {1}{2} x^{2} a^{3} B +a^{3} A x\) \(73\)
default \(\frac {b^{3} B \,x^{5}}{5}+\frac {\left (b^{3} A +3 a \,b^{2} B \right ) x^{4}}{4}+\frac {\left (3 a \,b^{2} A +3 a^{2} b B \right ) x^{3}}{3}+\frac {\left (3 a^{2} b A +a^{3} B \right ) x^{2}}{2}+a^{3} A x\) \(73\)
risch \(\frac {1}{5} b^{3} B \,x^{5}+\frac {1}{4} x^{4} b^{3} A +\frac {3}{4} x^{4} a \,b^{2} B +A a \,b^{2} x^{3}+B \,a^{2} b \,x^{3}+\frac {3}{2} x^{2} a^{2} b A +\frac {1}{2} x^{2} a^{3} B +a^{3} A x\) \(73\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x+a)^3*(B*x+A),x,method=_RETURNVERBOSE)

[Out]

1/5*b^3*B*x^5+1/4*(A*b^3+3*B*a*b^2)*x^4+1/3*(3*A*a*b^2+3*B*a^2*b)*x^3+1/2*(3*A*a^2*b+B*a^3)*x^2+a^3*A*x

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 69 vs. \(2 (34) = 68\).
time = 0.30, size = 69, normalized size = 1.82 \begin {gather*} \frac {1}{5} \, B b^{3} x^{5} + A a^{3} x + \frac {1}{4} \, {\left (3 \, B a b^{2} + A b^{3}\right )} x^{4} + {\left (B a^{2} b + A a b^{2}\right )} x^{3} + \frac {1}{2} \, {\left (B a^{3} + 3 \, A a^{2} b\right )} x^{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^3*(B*x+A),x, algorithm="maxima")

[Out]

1/5*B*b^3*x^5 + A*a^3*x + 1/4*(3*B*a*b^2 + A*b^3)*x^4 + (B*a^2*b + A*a*b^2)*x^3 + 1/2*(B*a^3 + 3*A*a^2*b)*x^2

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 69 vs. \(2 (34) = 68\).
time = 1.27, size = 69, normalized size = 1.82 \begin {gather*} \frac {1}{5} \, B b^{3} x^{5} + A a^{3} x + \frac {1}{4} \, {\left (3 \, B a b^{2} + A b^{3}\right )} x^{4} + {\left (B a^{2} b + A a b^{2}\right )} x^{3} + \frac {1}{2} \, {\left (B a^{3} + 3 \, A a^{2} b\right )} x^{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^3*(B*x+A),x, algorithm="fricas")

[Out]

1/5*B*b^3*x^5 + A*a^3*x + 1/4*(3*B*a*b^2 + A*b^3)*x^4 + (B*a^2*b + A*a*b^2)*x^3 + 1/2*(B*a^3 + 3*A*a^2*b)*x^2

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 73 vs. \(2 (32) = 64\).
time = 0.02, size = 73, normalized size = 1.92 \begin {gather*} A a^{3} x + \frac {B b^{3} x^{5}}{5} + x^{4} \left (\frac {A b^{3}}{4} + \frac {3 B a b^{2}}{4}\right ) + x^{3} \left (A a b^{2} + B a^{2} b\right ) + x^{2} \cdot \left (\frac {3 A a^{2} b}{2} + \frac {B a^{3}}{2}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)**3*(B*x+A),x)

[Out]

A*a**3*x + B*b**3*x**5/5 + x**4*(A*b**3/4 + 3*B*a*b**2/4) + x**3*(A*a*b**2 + B*a**2*b) + x**2*(3*A*a**2*b/2 +
B*a**3/2)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 72 vs. \(2 (34) = 68\).
time = 1.15, size = 72, normalized size = 1.89 \begin {gather*} \frac {1}{5} \, B b^{3} x^{5} + \frac {3}{4} \, B a b^{2} x^{4} + \frac {1}{4} \, A b^{3} x^{4} + B a^{2} b x^{3} + A a b^{2} x^{3} + \frac {1}{2} \, B a^{3} x^{2} + \frac {3}{2} \, A a^{2} b x^{2} + A a^{3} x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^3*(B*x+A),x, algorithm="giac")

[Out]

1/5*B*b^3*x^5 + 3/4*B*a*b^2*x^4 + 1/4*A*b^3*x^4 + B*a^2*b*x^3 + A*a*b^2*x^3 + 1/2*B*a^3*x^2 + 3/2*A*a^2*b*x^2
+ A*a^3*x

________________________________________________________________________________________

Mupad [B]
time = 0.03, size = 65, normalized size = 1.71 \begin {gather*} x^2\,\left (\frac {B\,a^3}{2}+\frac {3\,A\,b\,a^2}{2}\right )+x^4\,\left (\frac {A\,b^3}{4}+\frac {3\,B\,a\,b^2}{4}\right )+\frac {B\,b^3\,x^5}{5}+A\,a^3\,x+a\,b\,x^3\,\left (A\,b+B\,a\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A + B*x)*(a + b*x)^3,x)

[Out]

x^2*((B*a^3)/2 + (3*A*a^2*b)/2) + x^4*((A*b^3)/4 + (3*B*a*b^2)/4) + (B*b^3*x^5)/5 + A*a^3*x + a*b*x^3*(A*b + B
*a)

________________________________________________________________________________________